/**
 * Created with CLion.
 * Description: 
 * User: loong
 * Date: 2025/5/22
 * Time: 23:07
 */

#ifndef COLLIDER_H
#define COLLIDER_H
#include "../core/ObjectAffiliate.h"
class Collider : public ObjectAffiliate
{
public:
    enum Type
    {
        CIRCLE,// size_ 的 x 轴为直径, 默认 y=x;
        RECTANGLE
    };

    static Collider * AddColliderChild(ObjectScreen * _parent, glm::vec2 _size, Type _type = Type::CIRCLE, Anchor _anchor = Anchor::CENTER);

    void Render() override;

    bool IsColliding(Collider * other);

    Type GetType() const { return type_; }

    void SetType(Type type) { type_ = type; }

protected:

    Type type_ = Type::CIRCLE;
};

#endif//COLLIDER_H
